/**
 * 诗人3D模型配置
 * 定义每个诗人的3D模型路径、动画和渲染设置
 */

export const POET_MODELS_CONFIG = {
    liqingzhao: {
        name: '李清照',
        modelUrl: '/static/models/characters/lqzpro2.glb',
        position: { x: -16.766, y:-0.6, z: 7.662},
        rotation: { x: 0, y: 1.8, z: 0 },
        scale: 1.0,
        animations: {
            idle: 'idle',
            speaking: 'speaking',
            thinking: 'thinking',
            greeting: 'greeting'
        },
        materials: {
            // 李清照特定的材质设置
            skin: {
                roughness: 0.3,
                metalness: 0.0,
                envMapIntensity: 0.8
            },
            clothing: {
                roughness: 0.6,
                metalness: 0.1
            }
        },
        lighting: {
            // 适合李清照的光照设置
            ambientIntensity: 0.4,
            directionalIntensity: 0.8,
            shadowIntensity: 0.6
        },
        camera: {
            // 推荐的相机位置
           position: { x: 0, y: 0, z: 0 },
            target: { x: 0, y: 0, z: 0 }
        },
        description: '宋代女词人，婉约派代表',
        dynasty: '宋朝',
        style: '婉约清丽，情真意切'
    },
    libai: {
        name: '李白',
        modelUrl: '/static/models/characters/lqzpro2.glb',
        position: { x: -16.766, y:-0.6, z: 7.662},
        rotation: { x: 0, y: 0, z: 0 },
        scale: 2.0,
        animations: {
            idle: 'idle',
            speaking: 'speaking',
            thinking: 'thinking',
            greeting: 'greeting'
        },
        materials: {
            skin: {
                roughness: 0.35,
                metalness: 0.0,
                envMapIntensity: 0.7
            },
            clothing: {
                roughness: 0.55,
                metalness: 0.1
            }
        },
        lighting: {
            ambientIntensity: 0.5,
            directionalIntensity: 1.0,
            shadowIntensity: 0.7
        },
        camera: {
            position: { x: 0, y: 0, z: 0 },
            target: { x: 0, y: 1.2, z: 0 }
        },
        description: '唐代诗仙，浪漫主义代表',
        dynasty: '唐朝',
        style: '豪放浪漫，想象瑰丽'
    },
    dufu: {
        name: '杜甫',
        modelUrl: '/static/models/characters/dufu.glb',
        position: { x: 0, y: 1, z: 2 },
        rotation: { x: 0, y: 0, z: 0 },
        scale: 1.0,
        animations: {
            idle: 'idle',
            speaking: 'speaking',
            thinking: 'thinking',
            greeting: 'greeting'
        },
        materials: {
            skin: {
                roughness: 0.35,
                metalness: 0.0,
                envMapIntensity: 0.7
            },
            clothing: {
                roughness: 0.55,
                metalness: 0.1
            }
        },
        lighting: {
            ambientIntensity: 0.5,
            directionalIntensity: 1.0,
            shadowIntensity: 0.7
        },
        camera: {
            position: { x: 0, y: 1.6, z: 3 },
            target: { x: 0, y: 1.2, z: 0 }
        },
     
    },
    sushi: {
        name: '苏轼',
        // modelUrl: '/static/models/characters/lego_mesh.glb',
          modelUrl: '/static/models/characters/sushi.glb',
        position: { x: 1, y: 4, z: 7 },
        rotation: { x: 0, y: 0, z: 0 },
        scale: 1.0,
        animations: {
            idle: 'idle',
            speaking: 'speaking',
            thinking: 'thinking',
            greeting: 'greeting'
        },
        materials: {
            skin: {
                roughness: 0.35,
                metalness: 0.0,
                envMapIntensity: 0.7
            },
            clothing: {
                roughness: 0.55,
                metalness: 0.1
            }
        },
        lighting: {
            ambientIntensity: 0.5,
            directionalIntensity: 1.0,
            shadowIntensity: 0.7
        },
        camera: {
            position: { x: 0, y: 1.6, z: 3 },
            target: { x: 0, y: 1.2, z: 0 }
        },
        
    }
};

/**
 * 获取诗人模型配置
 * @param {string} poetId - 诗人ID
 * @returns {Object|null} 模型配置对象
 */
export function getPoetModelConfig(poetId) {
    return POET_MODELS_CONFIG[poetId] || null;
}

/**
 * 获取所有可用的诗人模型
 * @returns {Array} 诗人ID数组
 */
export function getAvailablePoetModels() {
    return Object.keys(POET_MODELS_CONFIG);
}

/**
 * 检查诗人是否有3D模型
 * @param {string} poetId - 诗人ID
 * @returns {boolean} 是否有模型
 */
export function hasPoetModel(poetId) {
    return poetId in POET_MODELS_CONFIG;
}

/**
 * 获取默认诗人模型配置
 * @returns {Object} 默认配置
 */
export function getDefaultPoetModelConfig() {
    return {
        name: '默认诗人',
        modelUrl: null,
        position: { x: 0, y: 0, z: 0 },
        rotation: { x: 0, y: 0, z: 0 },
        scale: 1.0,
        animations: {
            idle: 'idle',
            speaking: 'speaking',
            thinking: 'thinking',
            greeting: 'greeting'
        },
        materials: {
            skin: {
                roughness: 0.4,
                metalness: 0.0,
                envMapIntensity: 0.8
            },
            clothing: {
                roughness: 0.6,
                metalness: 0.1
            }
        },
        lighting: {
            ambientIntensity: 0.4,
            directionalIntensity: 0.8,
            shadowIntensity: 0.6
        },
        camera: {
            position: { x: 0, y: 1.6, z: 3 },
            target: { x: 0, y: 1.2, z: 0 }
        }
    };
}